package com.axend.aerosense.home.entity;

import android.text.TextUtils;

public enum ReportTypeEnum {

    REPORT_SLEEP("Sleep", 370),
    REPORT_ADL("ADL", 400),
    ;

    private String type;    //报告类型
    private int dpHeight;   //页面WebView的展示高度

    ReportTypeEnum(String type, int dpHeight) {
        this.type = type;
        this.dpHeight = dpHeight;
    }

    public String getType() {
        return type;
    }

    public int getDpHeight() {
        return dpHeight;
    }

    public static ReportTypeEnum getReport(String type){
        if (TextUtils.isEmpty(type)) {
            return null;
        }

        for (ReportTypeEnum value : values()) {
            if (value.getType().toUpperCase().equals(type.toUpperCase())) {
                return value;
            }
        }

        return null;
    }
}
